/**
 * Created with JetBrains PhpStorm.
 * User: anynix
 * Date: 12-8-5
 * Time: 下午1:34
 * To change this template use File | Settings | File Templates.
 */

$(document).ready(function(){

    $('#submit').click(function(){
        var term = {
            'info' : $('#search').val()
        };

        $.getJSON('searchcontroller/search', term, function(data){
            content = '';
            for(i=0; i<data.length; i++){
                 content += '<div>'+data[i].BOOK_NAME+'<br>'+
                    data[i].DOUBAN_COMMENT+'<br>'+
                    '<img src="'+data[i].IMAGE_LINK+'"/>'+'<br>'+
                    '</div>';
            }
            $('#result').html(content);
        });

        return false;
    });
});